#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
int missingNumber(int* nums, int numsSize) {

    int x = 0;

    for (int i = 0; i < numsSize; i++) {
        x ^= nums[i];
    }

    for (int j = 1; j <= numsSize; j++)
    {
        x ^= j;
    }
    return x;

}

int main(){
	int arr[3] = { 3,0,1 };
	int sz = sizeof(arr) / sizeof(arr[0]);
    printf("%d",missingNumber(arr, sz));
	return 0;
}
